﻿<h3>
    Features - Classes - Type Checking</h3>
<hr>
<p>
    Type checking is built into class definitions.</p>
<h4>
    Example</h4>
<pre>$.class.ns("Joo");

Joo.Mammal = $.class.define(function() {
	var self = {
		breathsAir : true
	};
	return self;
});

Joo.Poodle = $.class.extend(Joo.Mammal, function() {
	var self = {
		isCute : true
	};
	return self;
});

Joo.Monkey = $.class.extend(Joo.Mammal, function() {
	var self = {
		usesTools : true
	};
	return self;
});

Joo.Human = $.class.extend(Joo.Monkey, function() {
	var self = {
		usesJooQuery : true
	};
	return self;
});

var mammal = new Joo.Mammal();
mammal.is(Joo.Mammal); // true
mammal.is(Joo.Poodle); // false
mammal.is(Joo.Monkey); // false
mammal.is(Joo.Human);  // false

var poodle = new Joo.Poodle();
poodle.is(Joo.Mammal); // true
poodle.is(Joo.Poodle); // true
poodle.is(Joo.Monkey); // false
poodle.is(Joo.Human);  // false

var monkey = new Joo.Monkey();
monkey.is(Joo.Mammal); // true
monkey.is(Joo.Poodle); // false
monkey.is(Joo.Monkey); // true
monkey.is(Joo.Human);  // false

var human = new Joo.Human();
human.is(Joo.Mammal); // true
human.is(Joo.Poodle); // false
human.is(Joo.Monkey); // true
human.is(Joo.Human);  // true</pre>
